<?php

/**
 * Picture form.
 *
 * @package    MVM Vehicle Showroom (r)
 * @subpackage form
 * @author     Bo Wang < beau32 [at] gmail.com >
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class PictureForm extends BasePictureForm {
  public function configure() {
    unset($this['vehicle_id']);
    $this->widgetSchema['filename'] = new sfWidgetFormInputFileEditable(array(
                    'file_src' => '/uploads/vehicle/'.$this->getObject()->getFilename(),
                    'is_image' => true,
                    'edit_mode' => !$this->isNew(),
                    'template' => '<div>%file%<br />%input%<br />%delete% %delete_label%</div>',
    ));
    $this->validatorSchema['filename_delete'] = new sfValidatorPass();
  }
}
